

package com.hazelcast.jet.impl.operation;

import com.hazelcast.jet.core.JobStatus;
import com.hazelcast.jet.impl.execution.init.JetInitDataSerializerHook;
import com.hazelcast.spi.impl.AllowedDuringPassiveState;

import java.util.concurrent.CompletableFuture;

public class GetJobStatusOperation extends AsyncJobOperation implements AllowedDuringPassiveState {

    public GetJobStatusOperation() {
    }

    public GetJobStatusOperation(long jobId) {
        super(jobId);
    }

    @Override
    public CompletableFuture<JobStatus> doRun() {
        return getJobCoordinationService().getJobStatus(jobId());
    }

    @Override
    public int getClassId() {
        return JetInitDataSerializerHook.GET_JOB_STATUS_OP;
    }
}
